<?php

class LogLib
{
	
	private static $logger = FALSE;

	private function __construct()
	{
		
	}

	/**
	 * @return Logger
	 */
	public static function getLogger()
	{
		if (self::$logger == FALSE)
		{
			self::$logger = new Logger();
		}
		return self::$logger;
	}

	public static function log($file, $message)
	{
		$file = $file . date("_Y-m-d") . '.log';
		if (is_array($message))
		{
			if(count($message)!=count($message,1))
			{
				foreach ($message as $key =>$var){
					if(is_array($var)){
						$message[$key]=implode($var, '] [');
					}
				}
			}
			$message=implode($message, '] [');
		}
		$message = date("[Y-m-d H:i:s] [".WebVisitor::getIp()."] [") . $message . ']' . "\n";
		error_log($message, 3, $file);
	}
}

?>